home *** CD-ROM | disk | FTP | other *** search
- import example.formike.ForMikeMIDlet;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Graphics;
-
- // $FF: renamed from: c
- public class class_0 extends Canvas implements CommandListener, Runnable {
- // $FF: renamed from: q int
- public int field_0 = 10;
- // $FF: renamed from: h example.formike.ForMikeMIDlet
- public final ForMikeMIDlet field_1;
- // $FF: renamed from: p boolean
- public final boolean field_2;
- // $FF: renamed from: g javax.microedition.lcdui.Command
- public final Command field_3;
- // $FF: renamed from: o java.lang.Thread
- public volatile Thread field_4 = null;
- // $FF: renamed from: n d
- public final d field_5;
- // $FF: renamed from: m int
- public int field_6 = ((Canvas)this).getWidth();
- // $FF: renamed from: l int
- public int field_7 = ((Canvas)this).getHeight();
- // $FF: renamed from: k int
- public int field_8 = 1;
-
- // $FF: renamed from: c () void
- public final void method_0() {
- this.field_1.c();
- }
-
- public final void showNotify() {
- if (this.field_5 != null) {
- this.field_5.af();
- }
-
- }
-
- public class_0(ForMikeMIDlet var1, Display var2) {
- this.field_1 = var1;
- this.field_2 = var2.isColor();
- this.field_5 = new d(this.field_2, this);
- ((Displayable)this).setCommandListener(this);
- this.field_3 = new Command("Exit", 7, 1);
- ((Displayable)this).addCommand(this.field_3);
- }
-
- public final void commandAction(Command var1, Displayable var2) {
- if (var1 == this.field_3) {
- this.field_1.b();
- }
-
- }
-
- // $FF: renamed from: e () void
- public final synchronized void method_1() {
- this.field_4 = new Thread(this);
- this.field_4.start();
- this.field_5.ag(1);
- }
-
- // $FF: renamed from: d () void
- public final synchronized void method_2() {
- this.field_4 = null;
- }
-
- public final void run() {
- Thread var1 = Thread.currentThread();
-
- try {
- while(var1 == this.field_4) {
- long var2 = System.currentTimeMillis();
- ((Canvas)this).repaint(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- long var4 = System.currentTimeMillis() - var2;
- if (var4 < (long)this.field_0) {
- synchronized(this){}
-
- try {
- this.wait((long)this.field_0 - var4);
- } catch (Throwable var10) {
- throw var10;
- }
- }
- }
- } catch (InterruptedException var11) {
- } catch (Exception var12) {
- }
-
- }
-
- public final void paint(Graphics var1) {
- try {
- if (this.field_8 != -1) {
- var1.translate(-var1.getTranslateX(), -var1.getTranslateY());
- var1.setColor(this.field_8 * -1);
- var1.fillRect(0, 0, this.field_6, this.field_7);
- var1.setColor(0);
- this.field_8 = -1;
- }
-
- var1.translate((this.field_6 - 101 >> 1) - var1.getTranslateX(), (this.field_7 - 80 >> 1) - var1.getTranslateY());
- this.field_5.ad(var1);
- } catch (Exception var3) {
- }
-
- }
-
- public final void keyPressed(int var1) {
- try {
- switch (var1) {
- case 42:
- this.field_5.ac();
- break;
- case 43:
- case 44:
- case 45:
- case 46:
- case 47:
- case 48:
- default:
- int var2 = ((Canvas)this).getGameAction(var1);
- switch (var2) {
- case 1:
- this.field_5.k();
- return;
- case 2:
- this.field_5.m();
- return;
- case 3:
- case 4:
- case 7:
- default:
- return;
- case 5:
- this.field_5.l();
- return;
- case 6:
- this.field_5.j();
- return;
- case 8:
- this.field_5.n();
- return;
- }
- case 49:
- this.field_5.h();
- break;
- case 50:
- this.field_5.k();
- break;
- case 51:
- this.field_5.i();
- break;
- case 52:
- this.field_5.m();
- break;
- case 53:
- this.field_5.n();
- break;
- case 54:
- this.field_5.l();
- break;
- case 55:
- this.field_5.h();
- break;
- case 56:
- this.field_5.j();
- break;
- case 57:
- this.field_5.i();
- }
- } catch (Exception var3) {
- }
-
- }
- }
-